The invention relates to generating text strings.
As shown in FIG. 1, to display a text character (e.g., an "h" 17) on a display 16, a central processing unit (CPU) 25 of a computer system 12 typically generates both monochrome raster data 11 defining the character and an address specifying the location on the display 16 at which the character should appear. A rasterizer 14 uses the raster data 11 and address to generate analog signals (e.g., RGB signals) which cause the character to appear at the desired location on the display 16.
As shown in FIG. 2, the raster data 11 directs the placement of foreground pixels (each pixel having a predetermined foreground color) of the character on the display 16 by defining a bit mask for a corresponding block 23 of pixels. One bit value (e.g., a logical one) sets the color of a corresponding pixel equal to a predetermined foreground color, and another bit value (e.g., a logical zero) leaves the color of the corresponding pixel unchanged (i.e., the background of the character is transparent). The size of the character (i.e., the width (in pixels) and height (in pixels) of the pixel block 23) is a function of a user selected character size, and the particular mask defined by the raster data 11 is a function of a user selected font.
The rasterizer 14 typically has a graphics engine 10 (FIG. 1) which stores a color value (e.g., a sixteen bit representation of the color of a pixel) for each foreground pixel of the character in a frame buffer 13 (FIG. 3). The frame buffer 13 typically is organized by subregions 30 with each subregion 30 containing color values (representative of foreground and background pixel colors) associated with a horizontal scan line (typically one pixel high and 1024 pixels wide) of the display 16. Thus, a character to be displayed is stored in a region 31 of the frame buffer 13 that includes portions of several subregions 30 (i.e., the character is drawn using several scan lines). As an example, for a character having a width of four pixels and a height of nine pixels, one subregion 30a contains four color values associated with the top line of the character, and one subregion 30b has four color values associated with the bottom line of the character. A digital-to-analog converter (DAC) 21 regularly receives the color values from the frame buffer 13 and uses the color values of each subregion 30 to generate one of the scan lines.
The rasterizer 14 typically draws a text string (e.g., a string "hello" 27 in FIG. 1) on the display 16 one character at a time. For example, to draw the string "hello," the graphics engine 10 first transfers the color values associated with the character "h" to the display 16. As a result, the character "h" appears on the display 16 (FIG. 4A). Next, the graphics engine 10 transfers the color values associated with the character "e" to the frame memory 13. As a result, the character "e" appears on the display 16 (FIG. 4B). The graphics engine 10 continues this process until all color values associated with the string are stored in the frame buffer 13, and as a result, the entire string appears on the display 16.
The memory cells of the frame buffer 13 typically are arranged in rows (often referred to as pages) and columns. Before one of the rows is accessed (read from or written to), the row must be precharged which introduces a delay (often referred to as a page fault delay) in accessing the row. Due to this required precharging, successive accesses to the same row (i.e., accesses that remain in the same page) require less time than successive accesses to different rows (i.e., no page fault delays for successive accesses to the same row).
The graphics engine 10 typically has to access several different pages in the frame buffer 13 to transfer the color values for one character. As an example, for a sixteen bit color value and a page size of four kilobytes, only the color values associated with two lines of the character are contained within one page (i.e., only two subregions 30 per page). As a result, when transferring the color values for a character to the frame buffer 13, the graphics engine 10 must access a different page (i.e., a page fault delay is introduced) for every two lines of the character.